package org.geekbang.projects.cs.servicebus.filter.impl;

import org.geekbang.projects.cs.integration.domain.PlatformCustomerStaff;
import org.geekbang.projects.cs.servicebus.filter.AbstractCustomerStaffFilter;
import org.geekbang.projects.cs.util.SensitiveWordUtil;

import java.util.ArrayList;

/**
 * @description:
 * @author: Kaijun Chen
 * @date: 2023/3/17
 */
public class CustomerStaffNameFilter extends AbstractCustomerStaffFilter {

    @Override
    public PlatformCustomerStaff execute(PlatformCustomerStaff customerStaff) {
        if (SensitiveWordUtil.judgeSensitivityWord(customerStaff.getStaffName())) {
            return null;
        }

        if (getNext() != null) {
            return getNext().execute(customerStaff);
        }

        return customerStaff;
    }
}
